<div class="row">
    <div class="col-sm-20">
        <h1 class="pagetitle" translate lib="web">{{ctrl.model.name}}</h1>
    </div>
</div>
<pre ng-show="ErrorMessage!=null">{{ ErrorMessage }}</pre>
<div ng-show="ctrl.errormessage != ''"" class=" alert alert-danger" role="alert">{{ctrl.errormessage}}</div>
<form ng-submit="ctrl.submit()" class="form-horizontal" role="form" autocomplete="off">
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label" translate lib="web">name</label>
        <div class="col-sm-4">
            <input ng-model="ctrl.model.name" class="form-control input-md" ng-disabled="ctrl.loading==true" />
        </div>
    </div>
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label" translate lib="web">stats</label>
        <div class="col-sm-4">
            <div>{{ctrl.stats}}</div>
        </div>
    </div>
    
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">project</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.projectid" required="required"
                ng-options="item._id as item.display for item in ctrl.projects | orderBy: 'display'"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label" translate lib="web">maxretries</label>
        <div class="col-sm-6">
            <input type="number" ng-model="ctrl.model.maxretries" class="input-md" />
        </div>
    </div>
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label" translate lib="web">retrydelay</label> seconds
        <div class="col-sm-6">
            <input type="number" ng-model="ctrl.model.retrydelay" class="input-md" />
        </div>
    </div>
    <div class="form-group">
        <label for="name" class="col-sm-2 control-label" translate lib="web">initialdelay</label> seconds
        <div class="col-sm-6">
            <input type="number" ng-model="ctrl.model.initialdelay" class="input-md" />
        </div>
    </div>
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">workflow</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.workflowid" required="required"
                ng-options="item.projectandname as item.display for item in ctrl.workflows | orderBy: 'display'"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">robot/role</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.robotqueue" required="required"
                ng-options="item._id as item.display for item in ctrl.users | orderBy: 'display'"
                ng-change="ctrl.loadselects()"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">amqpqueue</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.amqpqueue" required="required"
                ng-options="item.name as item.display for item in ctrl.amqpqueues | orderBy: 'display'"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">agent</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.amqpqueue" required="required"
                ng-options="(item.slug + 'agent') as item.name for item in ctrl.agents | orderBy: 'display'"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">package</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.packageid" required="required"
                ng-options="item._id as item.name for item in ctrl.packages | orderBy: 'name'"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" ng-disabled="ctrl.loading==true" class="btn btn-success" translate
                lib="web">save</button>
        </div>
    </div>
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">on success, push to</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.success_wiqid" required="required"
                ng-options="item._id as item.display for item in ctrl.workitemqueues | orderBy: 'display'"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="state" class="col-sm-2 control-label" translate lib="web">on failure, push to</label>
        <div class="col-sm-4">
            <select class="form-control" id="country" ng-model="ctrl.model.failed_wiqid" required="required"
                ng-options="item._id as item.display for item in ctrl.workitemqueues | orderBy: 'display'"
                ng-disabled="ctrl.loading==true">
            </select>
        </div>
    </div>


</form>